<template>
    个人设置页
    <div>
        手机号<input type="text" v-model="phone" placeholder="请输入你的手机号">
    </div>
    <div>
        <button @click="submit">提交</button>
    </div>
</template>

<script setup>
import {ref} from 'vue';
import {useRouter} from 'vue-router'
import {useStore} from 'vuex'

const router = useRouter()
const store = useStore()

const phone = ref('')


const submit = ()=>{
    store.commit("updateUserInfo",{
        ...store.state.userInfo,phone
    })
    alert("修改成功")
    router.push("/user-center.profile")
}
</script>